package com.example.sharding.controller;

import com.example.sharding.model.UserModel;
import com.example.sharding.service.IUserService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 刘房
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: ${todo}
 * @date 2020/8/816:44
 */
@Api
@RestController
public class UserController {

    @Autowired
    private IUserService userServiceImpl;

    @PostMapping("/save")
    public void save(UserModel userModel){
        userServiceImpl.save(userModel);
    }

    @GetMapping("/findAll")
    public List<UserModel> findAll(){
        return userServiceImpl.findAll();
    }
}
